package cn.powerone.scm.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.powerone.common.annotation.Excel;
import cn.powerone.common.core.domain.BaseEntity;

/**
 * 【请填写功能名称】对象 scm_inventory_log
 *
 * @author PowerOne
 * @date 2025-08-21
 */
@Setter
@Getter
public class ScmInventoryLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 记录主键 */
    private Long id;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long orderId;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderCode;

    /** 库存ID */
    @Excel(name = "库存ID")
    private Long inventoryId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long productId;


    private Long projectProductId;

    /** 产品名称 */
    @Excel(name = "产品名称")
    private String productName;

    /** 图纸版本 */
    @Excel(name = "图纸版本")
    private String drawingVersion;

    /** 产品图纸编号 */
    @Excel(name = "产品图纸编号")
    private String drawingNumberModel;

    /** 规格 */
    @Excel(name = "规格")
    private String specification;

    /** 单位 */
    @Excel(name = "单位")
    private String unit;

    /** SKU码 */
    @Excel(name = "SKU码")
    private String skuCode;

    /** 产品颜色 */
    @Excel(name = "产品颜色")
    private String color;

    /** 单价 */
    @Excel(name = "单价")
    private BigDecimal unitPrice;

    /** 仓库ID */
    @Excel(name = "仓库ID")
    private Long warehouseId;

    /** 库位ID */
    @Excel(name = "库位ID")
    private Long warehouseLocationId;

    /** 出入库请求ID */
    @Excel(name = "出入库请求ID")
    private Long inventoryLogRequestId;

    /** 本次出入库货物的请求类型。真实|虚拟 出入库 */
    @Excel(name = "本次出入库货物的请求类型。真实|虚拟 出入库")
    private Long typeInLib;

    /** 运送方式 */
    private Long transportChannel;

    /** 变动类型 */
    @Excel(name = "变动类型")
    private Long changeType;

    /** 变动数量 */
    @Excel(name = "变动数量")
    private Long changeQuantity;

    /** 变动前数量 */
    @Excel(name = "变动前数量")
    private Long beforeQuantity;

    /** 变动后数量 */
    @Excel(name = "变动后数量")
    private Long afterQuantity;

    /** 本次出入库订单全部数量 */
    @Excel(name = "本次出入库订单全部数量")
    private Long orderTotalQuantity;

    /** 本次出入库货物在库数量 */
    @Excel(name = "本次出入库货物在库数量")
    private Long orderQuantityInLib;

    /** 本次出入库货物不在库数量 */
    @Excel(name = "本次出入库货物不在库数量")
    private Long orderQuantityNotInLib;

    /** 本次出入库货物有问题的数量，单独另算 */
    @Excel(name = "本次出入库货物有问题的数量，单独另算")
    private Long quantityInThisTimeHasIssue;

    /** 本次出入库货物所在订单的账单情况 */
    @Excel(name = "本次出入库货物所在订单的账单情况")
    private Long BillStatus;

    /** 本次出入库货物的对账日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "本次出入库货物的对账日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date BillDueDate;

    /** 本次出入库货物的真实对账日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "本次出入库货物的真实对账日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date BillDate;

    /** 本次出入库货物的对账信息 */
    @Excel(name = "本次出入库货物的对账信息")
    private String BillComments;

    /** 本次出入库货物的对账注释 */
    @Excel(name = "本次出入库货物的对账注释")
    private String BillRemarks;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 操作人 */
    @Excel(name = "操作人")
    private String createdBy;

    /** 操作人ID */
    @Excel(name = "操作人ID")
    private Long createdById;

    /** 关联的产品信息 */
    private ScmProjectProducts scmProjectProducts;

    /** 订单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date orderDate;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderId", getOrderId())
                .append("orderCode", getOrderCode())
                .append("inventoryId", getInventoryId())
                .append("productId", getProductId())
                .append("projectProductId", getProjectProductId())
                .append("productName", getProductName())
                .append("drawingVersion", getDrawingVersion())
                .append("drawingNumberModel", getDrawingNumberModel())
                .append("specification", getSpecification())
                .append("unit", getUnit())
                .append("skuCode", getSkuCode())
                .append("color", getColor())
                .append("unitPrice", getUnitPrice())
                .append("warehouseId", getWarehouseId())
                .append("warehouseLocationId", getWarehouseLocationId())
                .append("inventoryLogRequestId", getInventoryLogRequestId())
                .append("typeInLib", getTypeInLib())
                .append("changeType", getChangeType())
                .append("changeQuantity", getChangeQuantity())
                .append("beforeQuantity", getBeforeQuantity())
                .append("afterQuantity", getAfterQuantity())
                .append("orderTotalQuantity", getOrderTotalQuantity())
                .append("orderQuantityInLib", getOrderQuantityInLib())
                .append("orderQuantityNotInLib", getOrderQuantityNotInLib())
                .append("quantityInThisTimeHasIssue", getQuantityInThisTimeHasIssue())
                .append("remark", getRemark())
                .append("BillStatus", getBillStatus())
                .append("BillDueDate", getBillDueDate())
                .append("BillDate", getBillDate())
                .append("BillComments", getBillComments())
                .append("BillRemarks", getBillRemarks())
                .append("createdAt", getCreatedAt())
                .append("createdBy", getCreatedBy())
                .append("createdById", getCreatedById())
                .toString();
    }
}
